<template>
  <el-icon @click="ck"
    ><CaretRight v-if="navBool" /><CaretLeft v-else
  /></el-icon>
</template>

<script setup lang="ts">
import { computed } from "vue";
import { CaretRight, CaretLeft } from "@element-plus/icons-vue";
import { mapState, useStore } from "vuex";
let store = useStore();
// import { ref } from "vue";
// let bool = ref(true);
let ck = () => {
  store.commit("SET_NAV_BOOL");
};

// $store.state.HomeModule.navBool // 可以直接在v-if中写这句话
const navBool = computed(() => store.state.HomeModule.navBool); // 也可以通过计算属性获取到值
</script>

<style lang="scss">
.el-header {
  line-height: 70px;
  .el-icon {
    font-size: 20px;
    cursor: pointer;
  }
}
</style>
